package com.ruoyi.common.sms.ali;

import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.sms.MsgResult;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName AliMsgUtil
 * @Description
 * @Author Small
 * @Date 2020/10/23 15:04
 * @Version 1.0
 **/
public class AliMsgUtil {



    private static final String TIME_FMT = "MM月dd日 HH:mm";


    /**
     * 驾驶员新订单短信通知
     *
     * @param mobile 手机号
     * @param carNum 车牌号
     * @param bookTime  预约时间
     * @param contactName  客户姓名
     * @return
     */
    public static MsgResult sentDriverNewOrderNotify(String mobile, String carNum, Date bookTime, String contactName){
        Map<String,String> param = new HashMap<>();
        param.put("carNum",carNum);
        param.put("bookTime", DateUtil.format(bookTime,TIME_FMT));
        param.put("contactName",contactName);
        return AliMsgApi.sendMsg(mobile,MsgBizEnum.DRIVER_NEW_ORDER_NOTIFY,param);
    }


    /**
     * 检测站新代驾订单通知
     *
     * @param mobile  手机号
     * @param carNum  车牌号
     * @param driverName  司机姓名
     * @return
     */
    public static MsgResult sendStationNewDriverOrderNotify(String mobile,String carNum,String driverName){
        Map<String,String> param = new HashMap<>();
        param.put("carNum",carNum);
        param.put("driverName",driverName);
        return AliMsgApi.sendMsg(mobile,MsgBizEnum.STATION_NEW_DRIVER_ORDER_NOTIFY,param);
    }

    /**
     * 检测站新代驾订单通知
     *
     * @param mobile  手机号
     * @param carNum  车牌号
     * @param contractName  客户姓名
     * @return
     */
    public static MsgResult sendStationNewZjOrderNotify(String mobile,String carNum,String contractName){
        Map<String,String> param = new HashMap<>();
        param.put("carNum",carNum);
        param.put("contractName",contractName);
        return AliMsgApi.sendMsg(mobile,MsgBizEnum.ZJSC_STATION_NEW_ORDER_NOTIFY,param);
    }


    /**
     * 驾驶员接单用户提醒短信
     *
     * @param mobile  手机号
     * @param driverName  驾驶员名称
     * @param driverMobile  驾驶员手机号
     * @return
     */
    public static MsgResult sendDriverGradOrderMemberNotify(String mobile,String driverName,String driverMobile){
        Map<String,String> param = new HashMap<>();
        param.put("driverName",driverName);
        param.put("driverMobile",driverMobile);
        return AliMsgApi.sendMsg(mobile,MsgBizEnum.DRIVER_GRAD_ORDER_MEMBER_NOTIFY,param);
    }

  /**
     * 车辆检测完成驾驶员提醒
     *
     * @param mobile  手机号
     * @param carNum  车牌号
     * @return
     */
    public static MsgResult sendStationCheckFinishDriverNotify(String mobile,String carNum){
        Map<String,String> param = new HashMap<>();
        param.put("carNum",carNum);
        return AliMsgApi.sendMsg(mobile,MsgBizEnum.STATION_CHECK_FINISH_DRIVER_NOTIFY,param);
    }


    public static void main(String[] args) {
//      sentDriverNewOrderNotify("18736000723","豫A00000",new Date(),"张三");
        sendStationNewDriverOrderNotify("18736000723","豫A11111","李四");
    }
}
